

setTimeout(function () {
  console.log(2);
}, 1000 * 5);

Promise.reject(new Error('f123')).then(function (data) {
  console.log(data);
}).then(function () {
  console.log(5);
});

// process.on('unhandledRejection', (reason, promise) => {
//  console.log('----------', reason);
// });

process.on('beforeExit', (code) => {
  console.log('Process beforeExit event with code: ', code);
});

process.on('exit', (code) => {
  console.log('Process exit event with code: ', code);
});